//
//  HQBaseRequestSDK+Custom.h
//  hqedu24olapp
//
//  Created by litianqi on 2018/1/11.
//  Copyright © 2018年 edu24ol. All rights reserved.
//

#import "HQBaseRequestSDK.h"

@interface HQBaseRequestSDK (Custom)
/* 针对有网|无网*/
- (void)hq_startRequestWithUsingCacheSuccess:(void (^)(id dataResults,BOOL isNetWork))success failure:(void (^)(NSError *error))failure;
/* 针对有网|无网*/
- (void)hq_startRequestWithUsingCacheWithLife:(NSInteger)lifeSecond Success:(void (^)(id dataResults,BOOL isNetWork))success failure:(void (^)(NSError *error))failure;


/**
 一个处理过response的请求-不带缓存
 */
- (void)hq_startRequestWithResultsHandledBlock:(void (^)(id dataResults,NSError *error))success;

/** 通常用于首页等主页面
 针对有网状态下，第一数据  请求快速返回缓存数据，否则不返回
 @param justOne  YES 表示一次请求只回调一次,针对缓存和网络两种都存在的回调，只会返回缓存的
 */
- (void)hq_startRequestWithUsingFirstPageCacheWithJustOne:(BOOL)justOneTime completedBlock:(void (^)(id dataResults,BOOL isNetWork,NSError *error))completedBlock;


/** 用于普通页面- **分页接口** 尽量不要采用该接口，否则要自己注意处理 isNetWork 的场景
 * @param justOne  YES 表示一次请求只回调一次,针对缓存和网络两种都存在的回调，只会返回缓存的; 否则可能返回两次,针对gcd的场景需要注意
 */
- (void)hq_startCommonNoPageRequestWithUsingCacheWithJustOne:(BOOL)justOneTime completedBlock:(void (^)(id dataResults,BOOL isNetWork,NSError *error))completedBlock;

/** 用于普通页面- 建议采用这个接口 **分页接口** 尽量不要采用该接口，否则要自己注意处理 isNetWork 的场景
 */
- (void)hq_startCommonNoPageRequestWithCacheCompletedBlock:(void (^)(id dataResults,BOOL isNetWork,NSError *error))completedBlock;
//resp 处理
- (void)hq_handleRequestRespone:(YTKBaseRequest *)request success:(void (^)(id data))success failure:(void (^)(NSError *error))failure;
@end

